﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;

namespace HafriyatService
{
    /// <summary>
    /// Summary description for Service
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]

    public class Service : System.Web.Services.WebService
    {
        [WebMethod]
        public string AddRecord(string data)
        {
            Database db = new Database();
            Fis fis = JsonConvert.DeserializeObject<Fis>(data);
            if (fis != null)
            {
                return db.AddRecord(fis);
            }
            return "";
        }

        [WebMethod]
        public string VeriAl(DateTime tarih)
        {
            Database db = new Database();
            return db.VeriOlustur(tarih);
        }

        [WebMethod]
        public string getTime()
        {
            Database db = new Database();
            return db.getTime();
        }
    }
}
